/** 
 * @Title: ListCarDao.java 
 * @Package com.zizo.autohome.listed.dao 
 * @Description: TODO
 * @author HeYan
 * @date 2016年8月31日 下午3:58:52 
 */
package com.zizo.autohome.listed.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.List;

import com.zizo.autohome.listed.bean.ListCar;
import com.zizo.core.DAO;
import com.zizo.core.T;
import com.zizo.util.Util;

/**
 * @ClassName: ListCarDao
 * @Description: TODO
 * @author HeYan
 * @date 2016年8月31日 下午3:58:52
 * 
 */
public class ListCarDao extends DAO {
	public ListCarDao(Connection currConn) {
		super(currConn);
		// TODO Auto-generated constructor stub
	}
	public void insertData(ListCar listcar) {
		PreparedStatement ps = null;
		String sql = "REPLACE INTO autohome_other.other_listed_car(listed_news_id,listed_first_type,listed_second_type,listed_third_type,listed_uptime) VALUES(?,?,?,?,?)";
		try {
			ps = currConn.prepareStatement(sql);
			ps.setInt(1, listcar.getNewsid());
			ps.setInt(2, listcar.getFirst_type());
			ps.setInt(3, listcar.getSecond_type());
			ps.setString(4, listcar.getThird_type());
			ps.setTimestamp(5, (Timestamp) Util.getTimeHMS(Util.getCurrentDateTime()));
			ps.executeUpdate();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}

	@Override
	public List<String> getIDs() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int insertData(T t) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void updateTime(String type, String id) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public List<String> getTables() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int insertError(T t) {
		// TODO Auto-generated method stub
		return 0;
	}
}
